﻿-- Ajout de la colonne PrimaryTreeRootNodeId
IF NOT EXISTS(
Select * FROM Information_Schema.COLUMNS
where TABLE_SCHEMA = 'dbo'
AND TABLE_NAME = 'medianamik_Property'
AND Column_Name = 'PrimaryTreeRootNodeId'
)
BEGIN
	ALTER TABLE dbo.medianamik_Property ADD
	PrimaryTreeRootNodeId uniqueidentifier NULL
	
END

-- Ajout du CheckBoxTreeView

IF NOT EXISTS(SELECT NULL FROM dbo.Medianamik_MedianamikControl WHERE [MedianamikControlID] =   '7253B075-7A2C-450A-8C37-9E533C9708ED')  
BEGIN
DECLARE @q1 NVARCHAR(MAX)
SELECT @q1 = 'INSERT INTO [dbo].[medianamik_MedianamikControl]([MedianamikControlID],[Name],[MaySpecifyWidth],[DefaultWidth],[MaySpecifyHeight],[DefaultHeight],[MaySpecifyLength],[DefaultLength],[CreatedOn],[Type],[FullName],[MaySpecifyValidationExpression],[MayBeRequired],[MayBeUnique],[DataTypeID],[IsTree])
VALUES(''7253B075-7A2C-450A-8C37-9E533C9708ED'',''CheckBoxTreeView'',1,300,1,500,0,null,''2009-01-21 17:39:15.570'',2,''Medianamik.UI.Controls.CheckBoxTreeView, Medianamik.UI'',0,0,0,''0D5B7A19-A12A-46B5-9A2C-8D15093F5666'',1)
'
EXEC sp_executesql @q1
END